package org.huntaway.kindergarten.manager;

import java.util.List;

import org.huntaway.kernel.NutException;
import org.huntaway.kindergarten.po.Duty;
import org.huntaway.kindergarten.util.EnumUse;

public class DutyMng extends BaseMng<Duty> {
	@SuppressWarnings("unchecked")
	public List<Duty> getDuty() {
		return dateManage.findbyhql("from Duty").list();
	}

	public void save(Duty item) {
		item.setIsuse(EnumUse.NO.getValue());
		// updateEntityUse(item);
		super.save(item);
	}

	public void delete(Duty item) throws NutException {
		if (item.getIsuse().intValue() == EnumUse.YES.getValue()) {			
			throwException(item); 
		}
		super.delete(item);
	}	
}
